<template>
  <VanActionSheet
    v-model:show="showPopup"
    teleport="body"
    @closed="emit('close')"
    class="test-enter-popup"
  >
    <div class="content">
      <div class="select">
        <div class="more">
          <div class="more-text">更多</div>
        </div>
        <div class="again" @click="emit('clickAgain')">
          <img src="@/assets/images/wrongBook/icon-white-horn.png" />
          再做一次
        </div>
        <div class="check-detail" @click="emit('clickDetail')">
          <img src="@/assets/images/wrongBook/icon-check-detail.png" />
          查看详情
        </div>
      </div>
      <div class="btn">
        <VanButton
          size="small"
          color="linear-gradient( 270deg, #29F19C 0%, #02A1F9 100%)"
          @click="onClosePopup"
        >
          关闭
        </VanButton>
      </div>
    </div>
  </VanActionSheet>
</template>
<script setup>
import { defineProps, reactive, toRefs, watch, defineEmits } from "vue";

import { ActionSheet as VanActionSheet, Button as VanButton } from "vant";

const props = defineProps({
  show: {
    type: Boolean,
    default: false,
  },
  list: {
    type: Array,
    default: () => [],
  },
});
const emit = defineEmits(["clickAgain", "clickDetail"]);
const state = reactive({
  showPopup: false,
});
watch(
  () => props.show,
  (newVal) => {
    state.showPopup = newVal;
  }
);
const onClosePopup = () => {
  state.showPopup = false;
}
const { showPopup } = toRefs(state);
</script>
<style scoped lang="scss">
.test-enter-popup {
  font-family: PingFangSC, PingFang SC;
  .content {
    padding: 4px 20px 15px;
    font-size: 16px;
    color: #333333;
    .select {
      padding-bottom: 30px;
      .more {
        border-bottom: 1px solid #e5e5e5;
        padding: 15px 0;
        &-text {
          border-left: 4px solid #0cb76c;
          height: 14px;
          display: flex;
          align-items: center;
          padding-left: 10px;
        }
      }
      .again,
      .check-detail {
        border-bottom: 1px solid #e5e5e5;
        padding: 15px 20px;
        display: flex;
        align-items: center;
        img {
          width: 24px;
          margin-right: 15px;
        }
      }
    }
    .btn {
      box-sizing: border-box;
      width: 100%;
      .van-button {
        height: 45px;
        width: 100%;
        border-radius: 20px;
        font-size: 18px;
        font-weight: 500;
      }
    }
  }
}
</style>
